package com.zyh.controller;

import com.zyh.service.BookService;
import com.zyh.service.SelectTradeBillsServiceImpl;
import com.zyh.util.XmlRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.xml.bind.annotation.XmlRootElement;
import java.util.HashMap;
import java.util.Map;

/**
 * @author shihan
 * @date 2020-12-02-9:40
 */
@Controller
@RequestMapping("/selectBill")
public class SelectTradeBillsController {
    @Autowired
    @Qualifier("SelectTradeBillsServiceImpl")
    private SelectTradeBillsServiceImpl billsService;


    @RequestMapping(value ="/receiverSMS",method= RequestMethod.POST,consumes="application/xml")
    @ResponseBody
    public void receiverSMS(@RequestBody XmlRequest xmlreq) {


        System.out.println(xmlreq.toString());//XmlRequest(id=1111, name=沙河市第一高级中学, shortName=null)

        this.billsService.tradeBills(xmlreq);

    }


    }

